﻿<Page x:Class="Stankovita.Program.Pages.AddEditPages.AddEditManufactures"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:Stankovita.Program.Pages.AddEditPages"
      mc:Ignorable="d" 
      d:DesignHeight="650" d:DesignWidth="850"
      Title="AddEditManufactures">

    <Grid Background="WhiteSmoke">
        <Grid.RowDefinitions>
            <RowDefinition Height="60"/>
            <RowDefinition/>
        </Grid.RowDefinitions>

        <Grid Name="gridAddEditManufactures"
              Grid.Row="1"
              Width="450"
              Height="450">

            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition Height="60"/>
            </Grid.RowDefinitions>

            <!--Элементы в GroupBox-->
            <GroupBox Header="Добавление / Редактирование станка"
                      FontSize="20"
                      BorderBrush="Black"
                      BorderThickness="2">

                <Grid Margin="10">

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="150"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>

                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>

                    <!--Название-->
                    <TextBlock Text="Название"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Right"/>
                    <TextBox Name="InputNameMachineTxb"
                             Grid.Column="1"
                             Text="{Binding nameMachine}"
                             Margin="20"/>

                    <!--Фото-->
                    <TextBlock Grid.Row="1"
                               Text="Путь к фото"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Right"/>
                    <TextBox Name="PathToPhotoTxb"
                             Grid.Column="1"
                             Grid.Row="1"
                             HorizontalAlignment="Left"
                             Width="150"
                             Text="{Binding photo}"
                             Margin="20"/>
                    <Button Name="ChooseImageBtn"
                            Style="{DynamicResource ButtonStyle}"
                            Grid.Row="1"
                            Grid.Column="1"
                            Content="Сменить"
                            FontSize="15"
                            VerticalAlignment="Center"
                            HorizontalAlignment="Left"
                            Margin="175,0,0,0" 
                            Height="29" 
                            Width="73"
                            Click="ChooseImageBtn_Click"/>

                    <!--Дата производства-->
                    <TextBlock Grid.Row="2"
                               Text="Дата изгот."
                               VerticalAlignment="Center"
                               HorizontalAlignment="Right"/>
                    <TextBox Name="InputDateProdTxb"
                             Grid.Column="1"
                             Grid.Row="2"
                             Text="{Binding dateProd}"
                             Margin="20"/>

                    <!--Стоимость-->
                    <TextBlock Grid.Row="3"
                               Text="Стоимость (руб)"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Right"/>
                    <TextBox Name="InputCostTxb"
                             Text="{Binding cost}"
                             Grid.Row="3"
                             Grid.Column="1"
                             HorizontalAlignment="Center"
                             Width="230"
                             VerticalAlignment="Center"
                             Background="WhiteSmoke"
                             KeyDown="InputCostTxb_KeyDown"/>
                    <!--Скидка-->
                    <TextBlock Grid.Row="4"
                               Text="Скидка (%)"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Right"/>
                    <TextBox Name="InputDiscountTxb"
                             MaxLength="3"
                             Text="{Binding discount}"
                             Grid.Row="4"
                             Grid.Column="1"
                             HorizontalAlignment="Center"
                             Width="230"
                             VerticalAlignment="Center"
                             Background="WhiteSmoke"
                             KeyDown="InputDiscountTxb_KeyDown"/>
                </Grid>

            </GroupBox>

            <!--Сохранение-->
            <Button Name="SaveMachineBtn"
                    Grid.Row="1"
                    Style="{DynamicResource ButtonStyle}"
                    Content="Сохранить"
                    FontSize="20"
                    Margin="10"
                    HorizontalAlignment="Center"
                    Width="200"
                    Click="SaveMachineBtn_Click"/>

        </Grid>

        <!--Вернуться на страницу -->
        <Button Name="BackBtn"
                Style="{DynamicResource ButtonStyle}"
                Content="Назад"
                FontSize="20"
                Margin="5" 
                Click="BackBtn_Click"/>
    </Grid>
</Page>
